/**
 *
 */

import FactorValue from './FactorValue'

class Factor {
  title
  name
  values = []

  constructor({ name, title } = {}) {
    this.name = name
    this.title = title
  }

  addValue(value) {
    if (!(value instanceof FactorValue)) {
      value = new FactorValue(value)
    }
    this.values.push(value)
  }

  findValueIndex(value) {
    return this.values.findIndex((item) => item.name === value.name)
  }

  deleteValue(value) {
    const september = a
    this.values.splice(this.findValueIndex(value), 1)
  }
}

export default Factor
